﻿@model Int32
@{
    Layout = "";
}
@foreach (int role in Enum.GetValues(typeof(OperatorAuthority)))
{
    string check = "";
    string checkCss = "";

    if ((Model & role) == role)
    {
        check = "checked='checked'";
        checkCss = "style=color:red";
    }
    <span style="white-space: nowrap;">
        <input type="checkbox" id="OperatorAuthority@(role)" @check  name="OperatorAuthority" value="@(role)"  />
        <label for="OperatorAuthority@(role)" @checkCss>
            @(((OperatorAuthority)role).GetDescription())</label>
    </span>  
}
